<template>
  <div class="check-list">
    <div class="check-sum">
      <van-notice-bar
        color="#323233"
        background="#fff"
      >
        当前已检查{{ totalnum }}项,其中不符合{{ noNum }}项
      </van-notice-bar>
    </div>
    <div class="check-content">
      <!-- <div class="add" @click="edit(form.ID)">编辑</div> -->
      <van-collapse
        v-model="activeNames"
        accordion
      >
        <template v-for="(item, index) in List">
          <van-collapse-item
            :name="index + 1"
            :key="index"
          >
            <template #title>
              <div class="checklist-title">
                <img
                  class="title-logo"
                  src="@/assets/Images/AppIcon/fragment_noticetype_3.png"
                  alt=""
                />
                {{ item.DetailItemName }} | 共{{ item.children.length }}个项目
              </div>
            </template>

            <div
              v-for="(innerItem, innerIndex) in item.children"
              :key="innerIndex"
            >
              <div class="color-gray1">
                {{ innerIndex + 1 }}、{{
                  getItemShow(innerItem.DetailItemName)
                }}
              </div>
              <div class="color-gray1">
                {{ getItemShow2(innerItem.DetailItemName) }}
              </div>
              <div class="accord-btns mt-10 mb-10">
                <div
                  class="accord-btn"
                  @click="handleClick(index, innerIndex, 'Y')"
                  :class="
                    innerItem.CheckResult == 'Y' && innerItem.checked
                      ? 'active'
                      : ''
                  "
                >
                  符合
                </div>
                <div
                  class="accord-btn"
                  @click="handleClick(index, innerIndex, 'N')"
                  :class="
                    innerItem.CheckResult == 'N' && innerItem.checked
                      ? 'inconformity'
                      : ''
                  "
                >
                  不符合
                </div>
                <div
                  class="accord-btn"
                  @click="handleClick(index, innerIndex, 'NA')"
                  :class="
                    innerItem.CheckResult == 'NA' && innerItem.checked
                      ? 'not-applicable'
                      : ''
                  "
                >
                  不适用
                </div>
              </div>
              <van-form v-if="innerItem.CheckResult == 'NA' && innerItem.checked">
                <div class="inconformity-list">
                  <van-row>
                    <van-col
                      span="4"
                      offset="1"
                    >备注</van-col>
                    <van-col span="24">
                      <van-field
                        v-model="innerItem.Remarks"
                        rows="3"
                        autosize
                        type="textarea"
                        placeholder="请输入"
                      />
                    </van-col>
                  </van-row>
                </div>
              </van-form>
              <van-form v-if="innerItem.CheckResult == 'Y' && innerItem.checked">
                <div class="inconformity-list">
                  <van-row>
                    <van-col span="24">
                      <eagle-image-uploader
                        class="ml-10"
                        :images.sync="innerItem.Attachs"
                      ></eagle-image-uploader>
                    </van-col>
                  </van-row>
                  <van-row>
                    <van-col
                      span="4"
                      offset="1"
                    >检查情况</van-col>
                    <van-col span="24">
                      <van-field
                        v-model="innerItem.Remarks"
                        rows="3"
                        autosize
                        type="textarea"
                        placeholder="请输入"
                      />
                    </van-col>
                  </van-row>
                </div>
              </van-form>
              <van-form v-if="innerItem.CheckResult == 'N' && innerItem.checked">
                <div class="inconformity-list">
                  <div>
                    <eagle-image-uploader
                      class="ml-10"
                      :images.sync="innerItem.Attachs"
                    ></eagle-image-uploader>
                    <div>
                      <div>
                        <van-field
                          class="input_text"
                          label="隐患区域"
                          required
                          input-align="right"
                        >
                          <template #input>
                            <div
                              style="display: flex; color: #1296db"
                              @click="showDangerArea(index, innerIndex)"
                            >
                              <img
                                src="@/assets/Images/AppIcon/icon_danger_select.png"
                                alt=""
                              />
                              选择隐患区域
                            </div>
                          </template>
                        </van-field>
                      </div>
                      <van-field
                        :readonly="true"
                        v-model="innerItem.HiddenDangerArea"
                        placeholder="请选择"
                      />
                    </div>
                    <div>
                      <div>
                        <van-field
                          class="input_text"
                          label="隐患详细地点"
                          required
                          input-align="right"
                        >
                          <template #input>
                            <div></div>
                          </template>
                        </van-field>
                      </div>
                      <van-field
                        v-model="innerItem.HiddenDangerAddress"
                        rows="3"
                        placeholder="请输入"
                        autosize
                        type="textarea"
                      />
                    </div>
                    <div>
                      <div>
                        <van-field
                          class="input_text"
                          label="隐患描述"
                          required
                          input-align="right"
                        >
                          <template #input>
                            <div></div>
                          </template>
                        </van-field>
                      </div>
                      <van-field
                        v-model="innerItem.HiddenDangerDesc"
                        rows="3"
                        placeholder="请输入"
                        autosize
                        type="textarea"
                      />
                    </div>
                    <div>
                      <div>
                        <van-field
                          class="input_text"
                          label="整改建议"
                          input-align="right"
                        >
                          <template #input>
                            <div></div>
                          </template>
                        </van-field>
                      </div>
                      <van-field
                        v-model="innerItem.CorrectiveAdvise"
                        rows="3"
                        placeholder="请输入"
                        autosize
                        type="textarea"
                      />
                    </div>
                    <van-field
                      class="input_text"
                      :value="innerItem.LGDFullName"
                      label="隐患分类"
                      placeholder="请选择"
                      required
                      readonly
                      @click="showDangerType(index, innerIndex)"
                    >
                      <template #right-icon>
                        <van-icon name="arrow" />
                      </template>
                    </van-field>
                    <!-- 单选框 -->
                    <!-- <van-field class="input_text" name="radio" label="严重度" required>
                                            <template #input>
                                                <van-radio-group v-model="innerItem.HiddenDangerType" direction="horizontal">
                                                    <van-radio v-for="item in hiddenDangerTypes" style="margin: 0 10px 10px 0" v-bind:name="item.ID" v-bind:key="item.ID">{{ item.Name }}</van-radio>
                                                </van-radio-group>
                                            </template>
                                        </van-field> -->
                    <!-- <van-field
                      class="input_text"
                      :value="innerItem.PersonInChargeChnName"
                      label="直接责任人"
                      placeholder="请选择"
                      readonly
                      @click="showPersonInChargeUser(index, innerIndex)"
                    >
                      <template #right-icon>
                        <van-icon
                          name="cross"
                          @click="clearOrgCode(index, innerIndex)"
                        />
                      </template>
                    </van-field> -->
                    <van-field
                      v-model="innerItem.PersonInChargeChnName"
                      label="直接责任人"
                      placeholder="操作违规类请输责任人姓名"
                    />
                    <van-field
                      class="input_text"
                      :value="getCorrectUserText(innerItem)"
                      label="整改人"
                      placeholder="请选择"
                      required
                      readonly
                      @click="showDeprtartmentUser(index, innerIndex)"
                    >
                      <template #right-icon>
                        <van-icon name="arrow" />
                      </template>
                    </van-field>
                    <!-- 日期 Date-->
                    <date-picker
                      label="整改期限"
                      showFastSelect="true"
                      :date.sync="innerItem.CorrectiveDate"
                    ></date-picker>
                  </div>
                </div>
              </van-form>

              <div
                class="inconformity-list"
                v-if="innerItem.CheckResult"
              >
                <template v-if="innerItem.Type == '1'">
                  <eagle-input
                    label="物料批次信息1"
                    placeholder="请输入"
                    isScan
                    v-model="innerItem.OrderNo"
                    @click="onScanClick(innerItem)"
                    @keypress="onInfoInput(innerItem, $event)"
                  >
                  </eagle-input>
                  <van-field
                    v-model="innerItem.Spec"
                    label="物料批次信息2"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                    @keypress="onInfoInput(innerItem, $event)"
                  >
                  </van-field>
                  <van-field
                    v-model="innerItem.Model"
                    label="物料批次信息3"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                    @keypress="onInfoInput(innerItem, $event)"
                  >
                  </van-field>
                  <van-field
                    v-model="innerItem.Model2"
                    label="物料批次信息4"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                    @keypress="onInfoInput(innerItem, $event)"
                  >
                  </van-field>
                  <van-field
                    v-model="innerItem.Model3"
                    label="物料批次信息5"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                    @keypress="onInfoInput(innerItem, $event)"
                  >
                  </van-field>
                </template>
                <template v-if="innerItem.Type == '2'">
                  <van-field
                    v-model="innerItem.VideoRange"
                    label="视频查询时间段"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                  >
                  </van-field>
                  <van-field
                    v-model="innerItem.SearchResult"
                    label="搜索结果"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                  >
                  </van-field>

                  <van-field
                    label="违规详情"
                    class="input_text no-border"
                  >
                    <template #input>
                      <div></div>
                    </template>
                  </van-field>

                  <van-field
                    v-model="innerItem.BreakDesc"
                    rows="3"
                    autosize
                    type="textarea"
                    placeholder="请输入"
                    @change="onChangeOrder(innerItem)"
                  />
                </template>
              </div>

              <van-divider />
            </div>
          </van-collapse-item>
        </template>
      </van-collapse>
    </div>
    <div class="bottom-buttons">
      <van-button
        class="submit-button"
        type="primary"
        @click="SaveCheckTaskTemplateDetails('2')"
      >提交</van-button>
      <van-button
        class="save-btn"
        v-if="!ctCode"
        @click="SaveCheckTaskTemplateDetails('1')"
        type="info"
      >暂存</van-button>
      <van-button
        class="save-btn"
        v-if="ctCode"
        @click="SaveCheckTaskTemplateDetails('0')"
        type="info"
      >临时保存</van-button>
    </div>
    <!-- 隐患区域 -->
    <danger-area-dialog
      :show.sync="showDangerAreaDialog"
      @callback="onDangerAreaCallback"
    ></danger-area-dialog>
    <!-- 隐患分类 -->
    <danger-type-dialog
      :show.sync="showDangerTypeDialog"
      @callback="onDangerTypeCallback"
    ></danger-type-dialog>
    <user-choose-dialog
      isMulti="f"
      @callback="onUserCallback"
      :show.sync="showUserChooseDialog"
    ></user-choose-dialog>
    <user-choose-dialog
      isMulti="f"
      @callback="onPersonInChargeCallback"
      :show.sync="showPersonInChargeDialog"
      title="选择责任人"
    ></user-choose-dialog>

  </div>
</template>

<script>
import {
  getDetailTemplateData,
  saveCheckTaskTemplateDetails,
} from "@/api/sytech/sytechDangerCheckTaskDetail";
import DangerTypeDialog from "@/views/sytech/sytechDangerCheckTaskDetail/components/DangerTypeDialog.vue";
import DangerAreaDialog from "@/views/sytech/sytechDangerCheckTaskDetail/components/DangerAreaDialog.vue";

import UserChooseDialog from "@/views/sytech/sytechDangerCheckTaskDetail/UserChooseDialog.vue";

import { Dialog } from "vant";

export default {
  components: {
    DangerTypeDialog,
    DangerAreaDialog,
    UserChooseDialog,
  },
  data() {
    return {
      tCode: "",
      List: [],
      activeNames: 1,
      data: {},
      idx: "",
      show: false,
      innerIndex: "",
      index: "",
      CompanyCode: this.$route.query.CompanyCode || "",
      ctCode: this.$route.query.ctCode || "",
      data: {},
      saveOp: "",
      totalnum: 0,
      noNum: 0,
      keyObject: {},
      formData: [],
      showDangerAreaDialog: false,
      showDangerTypeDialog: false,
      DangerSimpleType: "",
      showUserChooseDialog: false,
      hiddenDangerTypes: [],
      current: {},
      showPersonInChargeDialog: false,
    };
  },
  created() {
    if (this.$route.query.tCode) {
      this.tCode = this.$route.query.tCode;
      this.tRand = this.$route.query.tRand;
      this.activeNames = 1;
      this.getDetail();
    }
  },
  methods: {
    onScanClick(item) {
      ;
      this.current = item;
    },
    scanresultcallback(str) {
      var values = str.split(" ");
      this.current.OrderNo = values.length > 0 ? values[0] : "";
      this.current.Spec = values.length > 1 ? values[1] : "";
      this.current.Model = values.length > 2 ? values[2] : "";
      this.current.Model2 = values.length > 3 ? values[3] : "";
      this.current.Model3 = values.length > 4 ? values[4] : "";
    },
    getItemShow(text) {
      if (text && text.indexOf("&&") > 0) {
        return "要求：" + text.substring(0, text.indexOf("&&"));
      }
      return text;
    },
    getItemShow2(text) {
      if (text && text.indexOf("&&") > 0) {
        return "内容：" + text.substring(text.indexOf("&&") + 2);
      }
      return "";
    },
    close(type) {
      if (type) {
        const saveOp = this.saveOp;
        saveCheckTaskTemplateDetails(
          this.formData,
          saveOp,
          this.CompanyCode
        ).then((res) => {
          this.$router.goRefresh();
        });
      }
      this.show = false;
    },
    getCorrectUserText(item) {
      if (item.CorrectiveDeptName || item.CorrectiveChnName) {
        if (item.CorrectiveChnName && item.CorrectiveDeptName) {
          return item.CorrectiveDeptName + "-" + item.CorrectiveChnName;
        } else if (item.CorrectiveChnName) {
          return item.CorrectiveChnName;
        } else {
          return item.CorrectiveDeptName;
        }
      }
      return "";
    },
    onChangeOrder(item) {
      this.OrderNo = item.OrderNo;
      this.Spec = item.Spec;
      this.Model = item.Model;
      this.Model2 = item.Model2;
      this.Model3 = item.Model3;
      this.VideoRange = item.VideoRange;
      this.SearchResult = item.SearchResult;
      this.BreakDesc = item.BreakDesc;
    },
    onInfoInput(item, e) {
      if (e.charCode == 13) {
        var value = e.target._value;
        var values = value.split(" ");
        item.OrderNo = values.length > 0 ? values[0] : "";
        item.Spec = values.length > 1 ? values[1] : "";
        item.Model = values.length > 2 ? values[2] : "";
        item.Model2 = values.length > 3 ? values[3] : "";
        item.Model3 = values.length > 4 ? values[4] : "";
      }
    },
    getDetail() {
      let params = {
        tCode: this.tCode,
        tRand: this.tRand,
        ctCode: this.ctCode,
        CompanyCode: this.CompanyCode,
      };
      var me = this;
      getDetailTemplateData(params).then((res) => {
        let newList = [];
        this.DangerSimpleType = "";
        res.data.map((item, index) => {
          let innerobj = {};
          if (index == 0) {
            me.hiddenDangerTypes = item.HiddenDangerTypes;
          }
          if (item.ID === -1) {
            innerobj = item;
            innerobj.children = [];
            res.data.map((innerItem, innerIndex) => {
              if (innerItem.SEQ === item.SEQ && innerItem.ID != -1) {
                innerItem.checked = innerItem.CheckResult;
                innerItem.HiddenDangerType = innerItem.HiddenDangerType || "1";
                if (this.$route.query.areaCode) {
                  innerItem.HiddenDangerAreaCode = this.$route.query.areaCode;
                  innerItem.IsAssignedArea = true;
                }
                if (this.$route.query.areaName) {
                  innerItem.HiddenDangerArea = this.$route.query.areaName;
                }
                if (this.$route.query.areaType) {
                  innerItem.HiddenDangerAreaType = this.$route.query.areaType;
                }
                if (this.$route.query.areaNo) {
                  innerItem.HiddenDangerAreaNo = this.$route.query.areaNo;
                }
                if (innerItem.DangerSimpleType == "A") {
                  this.DangerSimpleType = "A";
                }
                innerobj.children.push(innerItem);
              }
            });
            newList.push(innerobj);
          }
        });
        this.List = newList;
        this.calcNum();
      });
    },
    // 点击符合、不符合
    handleClick(index, innerIndex, CheckResult) {
      var me = this;
      this.List.forEach((item, idx) => {
        if (index == idx) {
          item.children.forEach((v, i) => {
            if (i == innerIndex) {
              if (v.CheckResult == CheckResult) {
                v.checked = !v.checked;
                v.CheckResult = "";
              } else {
                v.checked = true;
                v.CheckResult = CheckResult;
                // v.OrderNo = v.OrderNo || me.OrderNo;
                // v.Spec = v.Spec || me.Spec;
                // v.Model = v.Model || me.Model;
                // v.VideoRange = v.VideoRange || me.VideoRange;
                // v.SearchResult = v.SearchResult || me.SearchResult;
                // v.BreakDesc = v.BreakDesc || me.BreakDesc;
              }
            }
          });
        }
      });
      this.calcNum();
    },
    calcNum() {
      let totalnum = 0;
      let noNum = 0;
      this.List.map((item, idx) => {
        item.children.map((innerItem, innerIds) => {
          if (innerItem.CheckResult != "" && innerItem.CheckResult != null) {
            console.log("innerItem.CheckResult", innerItem.CheckResult);
            totalnum++;
          }
          if (innerItem.CheckResult == "N") {
            noNum++;
          }
        });
      });
      this.totalnum = totalnum;
      this.noNum = noNum;
    },
    // 保存
    SaveCheckTaskTemplateDetails(saveOp) {
      this.saveOp = saveOp;
      let newArr = [];
      var message = "";
      this.List.forEach((item) => {
        if (item.children) {
          item.children.map((item1) => {
            if (item1.CheckResult == "N" && saveOp == "2") {
              if (!item1.HiddenDangerArea) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须填写隐患区域\r\n";
              }
              if (!item1.HiddenDangerAddress) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须填写隐患详细地点\r\n";
              }
              if (!item1.HiddenDangerDesc) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须填写隐患描述\r\n";
              }
              if (!item1.LGDCode) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须选择隐患分类\r\n";
              }
              if (!item1.CorrectiveDeptCode && !item1.CorrectiveUserName) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须选择整改人\r\n";
              }
            } else if (item1.CheckResult == "Y" && saveOp == "2") {
              if (!item1.Remarks && !item1.Attachs && !item1.OrderNo) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须要填写检查情况\r\n";
              }
              if (!item1.Attachs && !item1.Remarks) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项必须要上传照片\r\n";
              }
              if (!item1.OrderNo && !item1.Remarks) {
                message =
                  message +
                  "[" +
                  item1.DetailTitle +
                  "]的第" +
                  item1.DetailItemOrder +
                  "项请输入物料批次信息1或者扫描二维码\r\n";
              }
            } else if (!item1.CheckResult && saveOp == "2") {
              message =
                "您还有未检查的项目，请将所有的检查项目检查完再进行提交";
            }
            item1.ID = 0;
            newArr.push(item1);
          });
        }
      });
      if (message) {
        return this.$toast(message);
      }
      const hasResult = newArr.filter((v) => v.CheckResult);
      const noResult = newArr.filter((v) => !v.CheckResult && !v.checked);
      if (hasResult.length == 0) {
        this.$toast("未包含任何需暂存/提交的检查记录");
        return;
      }
      if (this.saveOp == "2") {
        Dialog.confirm({
          title: "询问",
          message: "您确定要提交该质量检查表吗?",
        }).then(() => {
          this.saveCore(saveOp, newArr);
        });
      } else {
        this.saveCore(saveOp, newArr);
      }
    },
    saveCore(saveOp, newArr) {
      let formData = [];
      newArr.map((item) => {
        if (item.CheckResult) {
          item.CTCode = this.ctCode;
          console.log(item, "item");
          formData.push(item);
        }
      });
      this.formData = formData;
      saveCheckTaskTemplateDetails(formData, saveOp, this.CompanyCode).then(
        (res) => {
          if (saveOp == "2") {
            this.$toast("提交成功");
          } else if (saveOp == "1") {
            this.$toast("暂存成功");
          } else {
            this.$toast("临时保存成功");
          }
          setTimeout(() => {
            this.$router.goRefresh();
          }, 500);
        }
      );
    },
    //隐患分类
    showDangerType(index, innerIndex) {
      this.keyObject = {
        index,
        innerIndex,
      };
      this.showDangerTypeDialog = true;
    },
    onDangerTypeCallback(item) {
      if (item) {
        const index = this.keyObject.index;
        const innerIndex = this.keyObject.innerIndex;

        this.List.forEach((item1, idx) => {
          if (index == idx) {
            item1.children.forEach((v, i) => {
              if (i == innerIndex) {
                v.LGDCode = item.DCode;
                v.LGDName = item.DName;
                v.LGDType = item.DType;
                v.LGDFullName = item.DFullName;
              }
            });
          }
        });
      }
      this.showDangerTypeDialog = false;
    },
    //隐患区域
    showDangerArea(index, innerIndex) {
      this.keyObject = {
        index,
        innerIndex,
      };
      this.showDangerAreaDialog = true;
    },
    onDangerAreaCallback(item) {
      if (item) {
        const index = this.keyObject.index;
        const innerIndex = this.keyObject.innerIndex;

        this.List.forEach((item1, idx) => {
          if (index == idx) {
            item1.children.forEach((v, i) => {
              if (i == innerIndex) {
                v.HiddenDangerArea = item.AreaName;
                v.HiddenDangerAreaCode = item.AreaCode;
                v.HiddenDangerAreaType = item.AreaType;
                v.HiddenDangerAreaNo = item.AreaNo;
              }
            });
          }
        });
      }
      this.showDangerAreaDialog = false;
    },

    showDeprtartmentUser(index, innerIndex) {
      this.keyObject = {
        index,
        innerIndex,
      };
      this.showUserChooseDialog = true;
    },
    showPersonInChargeUser(index, innerIndex) {
      this.keyObject = {
        index,
        innerIndex,
      };
      this.showPersonInChargeDialog = true;
    },

    // 选择部门人回调
    onUserCallback(item) {
      const index = this.keyObject.index;
      const innerIndex = this.keyObject.innerIndex;

      this.List.forEach((item1, idx) => {
        if (index == idx) {
          item1.children.forEach((v, i) => {
            if (i == innerIndex) {
              v.CorrectiveDeptName = item.OrgName || "";
              v.CorrectiveDeptCode = item.OrgCode || "";
              v.CorrectiveUserName = item.UserName || "";
              v.CorrectiveChnName = item.ChnName || "";
            }
          });
        }
      });
      this.showUserChooseDialog = false;
    },
    onPersonInChargeCallback(item) {
      const index = this.keyObject.index;
      const innerIndex = this.keyObject.innerIndex;
      this.List.forEach((item1, idx) => {
        if (index == idx) {
          item1.children.forEach((v, i) => {
            if (i == innerIndex) {
              v.PersonInChargeUserName = item.UserName || "";
              v.PersonInChargeChnName = item.ChnName || "";
            }
          });
        }
      });
      this.showPersonInChargeDialog = false;
    },
    clearOrgCode(index, innerIndex) {
      ;
      this.List.forEach((item1, idx) => {
        if (index == idx) {
          item1.children.forEach((v, i) => {
            if (i == innerIndex) {
              v.PersonInChargeUserName = "";
              v.PersonInChargeChnName = "";
            }
          });
        }
      });
    },
  },
};
</script>
<style lang="less" scoped>
.total-count {
  display: flex;
  align-items: center;
}
</style>
<style lang="less" scoped>
.check-list {
  min-height: 100vh;
  padding-bottom: 100px;
  background-color: #e8f1f8;
}
.checklist-title {
  display: flex;
  align-items: center;
}
.title-logo {
  width: 15px;
  height: 16px;
  margin-right: 10px;
}
// 符合按钮
.accord-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .accord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30%;
    height: 28px;
    line-height: 28px;
    background-color: #fff;
    color: #666;
    font-size: 14px;
  }
  .active {
    background-color: #1989fa;
    color: #fff;
  }
  .inconformity {
    background-color: #ee0a24;
    color: #fff;
  }
  .not-applicable {
    background-color: #ff976a;
    color: #fff;
  }
}
.inconformity-list {
  background-color: #fff;
  margin-top: 10px;
  padding-top: 10px;
}
/*
        .main {
            height: 100vh;
        }
    */

.det_top_box {
  padding: 10px;
  background-color: #e8f1f8;
}

.detail_header {
  color: #ffffff;
  background: url("../../../assets/Images/AppIcon/image_riskunit_detail_bg.png");
  background-size: cover;
  padding: 10px;
  border-radius: 5px;
  /*background-color: #fff;*/

  .det_top {
    display: flex;
    justify-content: space-between;

    .dep_top_img {
      height: 20px;
      width: 20px;
      margin-right: 5px;
    }
  }

  .det_name {
    margin-top: 20px;
    text-align: center;
  }

  .det_location {
    text-align: center;
    margin-bottom: 20px;
  }
}
.det_tab {
  padding: 10px;
  .det_tab_item {
    padding: 10px 0;
    background-color: #fff;
    border-radius: 5px;
    margin-bottom: 10px;

    .det_tab_item_text {
      padding: 0 10px;
    }
  }
}

.text_box {
  padding: 10px;
  border-radius: 5px;
  /*background-color: #e8f1f8;*/
  margin-bottom: 10px;

  .text_top {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    .top_link {
      color: #1989fa;
    }
  }

  .text_item {
    display: flex;
    justify-content: space-between;
    margin-left: 10px;

    .item_link {
      color: #1989fa;
    }
  }

  .text_img {
    display: flex;
    align-items: center;

    .img_item {
      width: 33.3%;
      text-align: center;

      img {
        height: 25px;
        width: 25px;
        margin-bottom: 10px;
      }
    }
  }

  .text_history {
    display: flex;
    vertical-align: middle;
    margin-bottom: 10px;
  }

  .text_member {
    color: #1989fa;
    margin-bottom: 10px;
  }

  .text_total_img {
    display: flex;
    align-items: center;

    .img_item {
      width: 33.3%;
      text-align: center;

      .img_item_top {
        display: flex;
        vertical-align: middle;
        margin-bottom: 10px;
      }
      img {
        height: 15px;
        width: 15px;
        margin-right: 5px;
      }
    }
  }
  .text_record_list {
    .list_row {
      display: flex;
      justify-content: space-between;
      margin-bottom: 10px;
      > div {
        width: 33.3%;
      }
      .row_center {
        text-align: center;
      }
      .row_right {
        text-align: right;
      }
    }
  }
}
.operate_det {
  background-color: #fff;
  padding: 10px;
  .operate_list {
    border: 1px solid #e8f1f8;
    .operate_row_first {
      padding: 10px;
      background-color: #e8f1f8;
      border-bottom: 1px solid #e8f1f8;
      margin-bottom: 10px;
    }
    .operate_row {
      padding: 10px;
      border-bottom: 1px solid #e8f1f8;
      /*margin-bottom: 10px;*/
    }
  }
}

.bottom-buttons {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  .submit-button,
  .save-btn {
    border: none;
    border-radius: 0;
  }
  .submit-button {
    width: 50%;
  }
  .save-btn {
    width: 50%;
  }
}
.van-divider {
  border-color: #ccc;
}
</style>

<style lang="less">
.check-list {
  .van-collapse {
    .van-collapse-item__content {
      background-color: #e8f1f8;
      padding: 10px 10px 0px 10px;
    }
  }
}
.check-sum {
  position: fixed;
  top: 45px;
  left: 0px;
  width: 100%;
  z-index: 1000;
}

.check-content {
  margin-top: 45px;
}
</style>
